//
//  BLShopIngPointTableViewCell.m
//  blanket
//
//  Created by Mac on 2017/12/7.
//  Copyright © 2017年 stoneobs@icloud.com. All rights reserved.
//

#import "BLShopIngPointTableViewCell.h"
@interface BLShopIngPointTableViewCell()
@property(nonatomic, strong) UIImageView                     *iconImageView;
@property(nonatomic, strong) STLabel                         *titleLable;

@end
@implementation BLShopIngPointTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self configSubView];
    }
    return self;
}
+ (CGFloat)cellHeight{
    return 120;
}
#pragma mark --subView
- (void)configSubView{
    
    self.iconImageView = [[UIImageView alloc] initWithFrame:CGRectMake(15 , 25, 75, 75)];
    self.iconImageView.image = [UIImage imageNamed:@"banner1"];
    self.iconImageView.contentMode = UIViewContentModeScaleAspectFill;
    self.iconImageView.clipsToBounds = YES;
    [self.contentView addSubview:self.iconImageView];
    
    self.titleLable = [[STLabel alloc] initWithFrame:CGRectMake(self.iconImageView.right + 10, self.iconImageView.top  +3, UIScreenWidth - 20 - self.iconImageView.right, 35)
                                                text:@"酒店阿打算离开大家阿卡丽圣诞节大家拉丝机打了卡时间多啊搭建临时大"
                                           textColor:BL_firstTextColor
                                                font:14
                                         isSizetoFit:NO
                                       textAlignment:NSTextAlignmentLeft];
    self.titleLable.numberOfLines = 0;
    [self.contentView  addSubview:self.titleLable];
    
    self.priceLable = [[STLabel alloc] initWithFrame:CGRectMake(self.iconImageView.right + 10, self.titleLable.bottom, UIScreenWidth - 20 - self.iconImageView.right, 20)
                                                text:@"价格:￥456"
                                           textColor:BL_redColor
                                                font:14
                                         isSizetoFit:NO
                                       textAlignment:NSTextAlignmentLeft];
    [self.contentView  addSubview:self.priceLable];
    self.priceLable.attributedText = [self.priceLable.text st_convertAttributeStringWithKeyWord:@"价格:" attributes:@{NSForegroundColorAttributeName:BL_secendTextColor}];
    
    
    self.desLable = [[STLabel alloc] initWithFrame:CGRectMake(self.iconImageView.right + 10, self.priceLable.bottom, UIScreenWidth - 20 - self.iconImageView.right, 20)
                                                text:@"50积分+60盖币"
                                           textColor:BL_secendTextColor
                                                font:14
                                         isSizetoFit:NO
                                       textAlignment:NSTextAlignmentLeft];
    [self.contentView  addSubview:self.desLable];
}
- (void)setModel:(BLShopModel *)model{
    _model = model;
    [self.iconImageView sd_setImageWithURL:[NSURL URLWithString:model.cover_img_url]];
    
    self.titleLable.text = model.name;
    
    self.priceLable.text = [NSString stringWithFormat:@"价格:￥%@",model.price];
    self.priceLable.attributedText = [self.priceLable.text st_convertAttributeStringWithKeyWord:@"价格:" attributes:@{NSForegroundColorAttributeName:BL_secendTextColor}];
    
    self.desLable.text = [NSString stringWithFormat:@"%@积分 + %@元",model.score , model.cap_coin];
}
@end
